package com.example.c201901090104;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.jaeger.library.StatusBarUtil;

public class Firstpage extends AppCompatActivity {
    private Handler handler=new Handler(){
        public  void handleMessage(Message msg){
            super.handleMessage(msg);
            SharedPreferences sharedPreferences=getSharedPreferences("user",MODE_PRIVATE);
            Boolean success=sharedPreferences.getBoolean("success",false);
            if(success==false){
                Intent intent=new Intent(Firstpage.this,Login.class);
                startActivity(intent);
            }
            else{
                Intent intent=new Intent(Firstpage.this,MainActivity.class);
                startActivity(intent);
            }

            Firstpage.this.finish();
        }
    };
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_firstpage);


        StatusBarUtil.setTransparentForImageView(this,findViewById(R.id.firstpage_constraintLayout));
        handler.sendEmptyMessageDelayed(0,3000);

    }
}